Skip to content

Purge explicit packs on solution load#2503

Merged
brondani merged 8 commits into
mainfrom
fix/vscode330
Jun 26, 2026
Merged

Purge explicit packs on solution load#2503
brondani merged 8 commits into
mainfrom
fix/vscode330

Conversation

@edriouk

@edriouk edriouk commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Fixes

Changes

  • Purge packs with explicit paths on load solution and load packs
  • simplify duplicated pack reporting logic
  • remove redundant check for explicit packs

Checklist

  • 🤖 This change is covered by unit tests (if applicable).
  • 🤹 Manual testing has been performed (if necessary).
  • 🛡️ Security impacts have been considered (if relevant).
  • 📖 Documentation updates are complete (if required).
  • 🧠 Third-party dependencies and TPIP updated (if required).

@github-actions

github-actions Bot commented Jun 25, 2026

Copy link
Copy Markdown

Test Results

  7 files   -    51   53 suites   - 123   6m 8s ⏱️ - 17m 42s
185 tests  -   735  168 ✅  -   735  17 💤 ±0  0 ❌ ±0 
692 runs   - 2 205  624 ✅  - 2 205  68 💤 ±0  0 ❌ ±0 

Results for commit ca21e7c. ± Comparison against base commit 2054682.

This pull request removes 735 tests.
CodeGenerator ‑ Check
CrossPlatformUnitTests ‑ CanExecute
CrossPlatformUnitTests ‑ ExecCommand
CrossPlatformUnitTests ‑ GetEnv_Empty
CrossPlatformUnitTests ‑ GetEnv_Existing
CrossPlatformUnitTests ‑ GetEnv_NoExising
CrossPlatformUnitTests ‑ GetExecutablePath
CrossPlatformUnitTests ‑ GetLongPathRegStatus
CrossPlatformUnitTests ‑ GetPackRootDir_Default
CrossPlatformUnitTests ‑ GetPackRootDir_NoEnvSet
…

♻️ This comment has been updated with latest results.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR targets issue #330 by ensuring solution-specific packs (packs loaded from explicit paths) don’t “stick” across solution loads, which could cause the IDE/tooling to keep referencing stale local pack directories when switching solutions.

Changes:

  • Purge packs loaded from explicit paths during RPC LoadSolution, and clear the global model more aggressively when the registry changes.
  • Simplify pack insertion / duplicate reporting logic in the RTE model/kernel.
  • Extend/refactor RPC tests and test environment data to validate pack-path switching across solutions.

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/projmgr/test/src/ProjMgrTestEnv.cpp Adds an additional copied solution-specific pack folder for new/updated tests.
tools/projmgr/test/src/ProjMgrRpcTests.cpp Refactors RPC request building and adds coverage for switching solutions with the “same” pack from different explicit directories.
tools/projmgr/src/ProjMgrWorker.cpp Forces installed-pack discovery/loading in RPC mode when loading relevant packs.
tools/projmgr/src/ProjMgrRpcServer.cpp Purges packs at solution load and clears global state when purging occurs.
libs/rtemodel/src/RtePackage.cpp Extends pack-registry purge to also delete explicit-path packs.
libs/rtemodel/src/RteModel.cpp Simplifies duplicate-pack handling in InsertPack.
libs/rtemodel/src/RteKernel.cpp Removes redundant explicit-pack override filtering during LoadAndInsertPacks.
Comments suppressed due to low confidence (1)

tools/projmgr/src/ProjMgrWorker.cpp:555

  • In RPC mode this now calls GetEffectivePdscFiles(pdscFiles, ...) on a non-empty pdscFiles list, which appends the full installed-pack list. That can re-add entries already present from the solution’s pack requirements, and RteKernel::LoadAndInsertPacks() only does pdscFiles.unique() (adjacent-only), so duplicates may survive and cause redundant LoadPack()/InsertPack() work.

To keep ordering (explicit packs first) and avoid duplicates reliably, consider collecting installed PDSCs into a temporary list and then merging into pdscFiles via CollectionUtils::PushBackUniquely.

  if (m_rpcMode || pdscFiles.empty() || (m_loadPacksPolicy == LoadPacksPolicy::ALL) || (m_loadPacksPolicy == LoadPacksPolicy::LATEST)) {
    const bool latest = (m_loadPacksPolicy == LoadPacksPolicy::LATEST) || (m_loadPacksPolicy == LoadPacksPolicy::DEFAULT);
    if (!m_kernel->GetEffectivePdscFiles(pdscFiles, latest)) {
      ProjMgrLogger::Get().Error("parsing installed packs failed");
      return false;

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread libs/rtemodel/src/RtePackage.cpp Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Comment thread libs/rtemodel/include/RteModel.h Outdated
Comment thread tools/projmgr/src/ProjMgrRpcServer.cpp
Comment thread tools/projmgr/src/ProjMgrRpcServer.cpp
Comment thread tools/projmgr/test/src/ProjMgrRpcTests.cpp Outdated
edriouk and others added 5 commits June 25, 2026 14:31
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@edriouk edriouk requested a review from brondani June 26, 2026 14:34
@codecov

codecov Bot commented Jun 26, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.44444% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 65.26%. Comparing base (2054682) to head (ca21e7c).

Files with missing lines Patch % Lines
tools/projmgr/src/ProjMgrRpcServer.cpp 94.44% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2503      +/-   ##
==========================================
+ Coverage   65.24%   65.26%   +0.01%     
==========================================
  Files         147      147              
  Lines       26677    26692      +15     
  Branches    16166    16181      +15     
==========================================
+ Hits        17406    17421      +15     
  Misses       7071     7071              
  Partials     2200     2200              
Flag Coverage Δ
buildmgr-cov 79.87% <ø> (ø)
packchk-cov 69.75% <ø> (ø)
projmgr-cov 87.94% <94.44%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
tools/projmgr/src/ProjMgrRpcServer.cpp 85.76% <94.44%> (+0.19%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brondani brondani left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@brondani brondani merged commit 3e77d41 into main Jun 26, 2026
84 checks passed
@brondani brondani deleted the fix/vscode330 branch June 26, 2026 15:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants